package com.zero.yygh.common.utils;

import java.io.IOException;
import java.io.InputStream;

/**
 * @author zero
 * @desc io工具
 * @create 2021/4/8
 */
public class IoUtils {

    public static String toString(InputStream content, String charset) {
        byte[] bytes = new byte[0];
        try {
            bytes = new byte[content.available()];
            int read = content.read(bytes);
            return new String(bytes, charset);
        } catch (IOException e) {
            e.printStackTrace();
        }
        return "";
    }
}
